function kte = computeKte(i,elements,model)
e = model.getElement(i-1);
f = e.getFace();
ng = e.getNumGaussPoint();
nn = f.countModes();
dim = 2;
kte = zeros(dim*nn,dim*nn);
for j=1:ng
    xi = e.getGaussPoint(j-1);
    w = e.getGaussWeight(j-1);
    jac = f.jacXAt(xi);
    B = zeros(3,dim*nn);
    B = e.computeB(f,B,xi);
    C = elements(i).constitutiveMatrix(:,:,j);
    kte = kte + w*B'*C*B*abs(det(jac));
end
end
